<?php
namespace app\admin\model;
use think\Model;
use think\Db;

class MenuModel extends Model{
    protected $name = 'menu';
    public function insertMenu($param){
        try{
            $result =  $this->save($param);
            if(false === $result){
                return ['code' => -1, 'data' => '', 'msg' => $this->getError()];
            }else{
                return ['code' => 1, 'data' => '', 'msg' => '添加成功'];
            }
        }catch( PDOException $e){
            return ['code' => -2, 'data' => '', 'msg' => $e->getMessage()];
        }
    }
}